import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/components/common/Home'

import AllOrder from '@/components/pages/order/AllOrder'
import FirstPage from '@/components/pages/FirstPage'
import Login from "../components/common/Login.vue";
import User from "../components/pages/sys/User.vue"
import Role from "../components/pages/sys/Role.vue"
import stock from "../components/pages/sys/stock.vue"
import Customer from "../components/pages/customer/CustomerList.vue"
import Business from "../components/pages/sys/Business.vue";
import Region from "../components/pages/sys/Region.vue";
import Material from "../components/pages/sys/Material.vue";

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'login',  //主路由
      component: Login,
    },
    {
      path: '/Home',
      name: 'Home',  //主路由
      component: Home,
      redirect: 'FirstPage',
      children:[ //嵌套的子路由
        {
          path: '/FirstPage',
          name: 'firstPage',
          component: FirstPage
        },
        {
          path: '/Consumer',
          name: 'Customer',
          component: Customer
        },
        {
          path: '/AllOrder',
          name: 'AllOrder',
          component: AllOrder
        },
        {
          path: '/User',
          name: 'User',
          component: User
        },
        {
          path: '/Role',
          name: 'Role',
          component: Role
        },
        {
          path: '/stock',
          name: 'stock',
          component: stock
        },
        {
          path: '/Business',
          name: 'business',
          component: Business
        },
        {
          path: '/Region',
          name: 'region',
          component: Region
        },
        {
          path: '/Material',
          name: 'material',
          component: Material
        }
      ]
    },
  ]
})
